home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_PICT / Source / PICTFile.m < prev    next >
Text File  |  1995-06-12  |  21KB  |  584 lines

  1. /***********************************************************************\
  2. PICT file class for Convert PICT which converts graphics from PICT to eps formats.
  3. Copyright (C) 1993 David John Burrowes
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  10.  
  11. The author, David John Burrowes, can be reached at:
  12.     davidjohn@kira.net.netcom.com
  13.     David John Burrowes
  14.     1926 Ivy #10
  15.     San Mateo, CA 94403-1367
  16. \***********************************************************************/
  17.  
  18.  
  19. /*
  20. ====================================================================
  21. This is the implementation file for the PICTFile class.  Full documentation for this class can be found in the PICTFile.rtf file.  I will not duplicate all that fine information here.
  22.     This is $Revision: 1.10 $ of this file
  23.     It was last modified by $Author: death $ on $Date: 93/04/04 23:29:46 $
  24. Note that this file was created while using the New Century Schoolbook Roman typeface.  You may find that some things line up strangely if you don't use that family.
  25. * $Log:    PICTFile.m,v $
  26. Revision 1.10  93/04/04  23:29:46  death
  27. Sun Apr  4 23:29:45 PDT 1993
  28.  
  29. Revision 1.9  93/01/09  21:07:04  death
  30. Sat Jan  9 21:07:04 PST 1993
  31.  
  32. Revision 1.8  93/01/01  11:51:13  death
  33. Fri Jan  1 11:51:12 PST 1993
  34.  
  35. Revision 1.7  92/12/31  15:34:01  death
  36. Thu Dec 31 15:34:01 PST 1992
  37.  
  38. Revision 1.6  92/12/05  23:06:55  death
  39. Sat Dec  5 23:06:54 PST 1992
  40.  
  41. Revision 1.5  92/12/03  18:01:12  death
  42. Thu Dec  3 18:01:11 PST 1992
  43.  
  44. Revision 1.4  92/11/27  19:37:24  death
  45. Fri Nov 27 19:37:24 PST 1992
  46.  
  47. Revision 1.3  92/11/08  09:26:15  death
  48. Sun Nov  8 09:26:15 PST 1992
  49.  
  50. Revision 1.2  92/08/09  19:46:19  death
  51. Sun Aug  9 19:46:19 PDT 1992
  52.  
  53. Revision 1.1  92/08/09  08:53:00  death
  54. Sun Aug  9 08:52:59 PDT 1992
  55.  
  56. *====================================================================
  57. */
  58.  
  59. //
  60. //    Import our own definition
  61. //
  62. #import "PICTFile.h"
  63. #import <architecture/byte_order.h>    // for big/little endian conversins
  64.  
  65.  
  66. @implementation PICTFile
  67.  
  68.  
  69. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  70. //    Routine:        free
  71. //    Parameters:    none
  72. //    Returns:        self
  73. //    Stores:        none
  74. //    Description:
  75. //        Frees various data owned by the instance.  
  76. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  77. - free
  78. {
  79.     if (PICTHeader != NullByteString)
  80.         FreeByteString(PICTHeader);
  81.     if (BoundingRect != (PICTRect*) NullByteString)
  82.         FreeByteString((ByteString)BoundingRect);
  83.     return [super   free];
  84. }
  85.  
  86.  
  87. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  88. //    Routine:        OpenWithAccess:
  89. //    Parameters:    the means of accessing the specified file
  90. //    Returns:        self
  91. //    Stores:        none
  92. //    Description:
  93. //        This is a simple subclass-ed method from the File class.  This simply traps to
  94. //        make sure that the operation is not one that involves file writing, as this is not
  95. //        supported at present by the PICTFile class.  If it is an operation involving
  96. //        writing, and error is set, and this returns self.
  97. //    Bugs:
  98. //        We don't check for errors when reading the header or opcodes or anything...
  99. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  100. - OpenWithAccess: (AccessType) operation
  101. {
  102.     PICTOpcode    theOpcode;
  103.     [self ResetResults];
  104.     
  105.     if (operation != FILE_READ)
  106.     {
  107.         [self   StoreErrorCode: ERR_MAYNOTWRITE 
  108.             AndText: "You may ONLY read from a PICT file."];
  109.     }
  110.     else
  111.     {
  112.         [super   OpenWithAccess: operation];
  113.         if ([self   GetErrorCode] == ERR_OK)
  114.         {
  115.             PICTHeader = NewByteString(512);
  116.             [self   Read: 512 BytesInto: PICTHeader];
  117.             [self   AdvanceBytes: 2];    // skip the size
  118.             BoundingRect = [self   GetRect];
  119.             //
  120.             //    92.12.03    djb    Added because I found a Superpaint doc which had a large
  121.             //                number of 0's after the bounding rect.  Weird.
  122.             //
  123.             do
  124.             {
  125.                 theOpcode = [self   GetOpcode];
  126.             }
  127.             while( (theOpcode == 0) && ([self   GetErrorCode] != ERR_EOF));
  128.             
  129.             if (theOpcode == 0x11)
  130.             {
  131.                 switch ([self   GetByte])
  132.                 {
  133.                     case 0x01:
  134.                         PICTVersion = 1;
  135.                         break;
  136.                     case 0x02:
  137.                         PICTVersion = 2;
  138.                         break;
  139.                 }
  140.             }
  141.             if (PICTVersion == 0)
  142.             {
  143.                 PICTVersion = 9999;    // unlikely Apple will ever do a 9999 vers. =)
  144.                 [self   StoreErrorCode: ERR_UNKNOWNVERSION
  145.                     AndText: "Unknown PICT version!"];
  146.             }
  147.         }
  148.     }
  149.  
  150.     return self;
  151. }
  152.  
  153.  
  154. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  155. //    Routine:        initAndUse:
  156. //    Parameters:    none
  157. //    Returns:        self
  158. //    Stores:        none
  159. //    Description:
  160. //        This is a simple subclass-ed method from the File class.  We subclass it
  161. //        because we need to initalize our instance variables.
  162. //    Bugs:
  163. //        We don't initalize the bounding rect
  164. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  165. - initAndUse: (roCString) pathname
  166. {
  167.     [super initAndUse: pathname];
  168.     
  169.     PICTHeader = NullByteString;
  170.     PICTVersion = 0;
  171.     FoundEnd = NO;
  172.  
  173.     return self;
  174. }
  175.  
  176.  
  177. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  178. //    Routine:        initAndUseTemporary
  179. //    Parameters:    none
  180. //    Returns:        self
  181. //    Stores:        none
  182. //    Description:
  183. //        This is a simple subclass-ed method from the File class.  This method essentially
  184. //        implies doing write access to a file, which we don't presently support, so we just
  185. //        return an error indirectly by setting FoundEnd to be YES.
  186. //    Bugs:
  187. //        We should be setting an error here.
  188. //        We don't initalize the bounding rect
  189. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  190. - initAndUseTemporary
  191. {
  192.     [super initAndUseTemporary];
  193.     
  194.     PICTHeader = NullByteString;
  195.     PICTVersion = 0;
  196.     FoundEnd = YES;
  197.     return self;
  198. }
  199.  
  200.  
  201.  
  202. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  203. //    Routine:        GetVersion
  204. //    Parameters:    none
  205. //    Returns:        an integer representing the PICT file version number
  206. //    Stores:        none
  207. //    Description:
  208. //        Returns the version number of the PICT file to the caller.
  209. //    Bugs:
  210. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  211. - (Integer) GetVersion
  212. {
  213.     return PICTVersion;
  214. }
  215.  
  216.  
  217. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  218. //    Routine:        GetHeader
  219. //    Parameters:    none
  220. //    Returns:        A pointer to a block of constant data that is a copy of the 512byte
  221. //                pict file header. 
  222. //    Stores:        none
  223. //    Description:
  224. //        Returns a pointer to the 512 byte header of the PICT file.  The 512 bytes are
  225. //        not terminated in any way, and it is assumed the caller is aware of this.
  226. //    Bugs:
  227. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  228. - (ConstByteString) GetHeader
  229. {
  230.     return PICTHeader;
  231. }
  232.  
  233. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  234. //    Routine:        GetBounds
  235. //    Parameters:    none
  236. //    Returns:        A pointer to a new struct describing the bounds of the pict file
  237. //    Stores:        none
  238. //    Description:
  239. //        Returns a rectangle struct to the caller containing the boundrary rectangl
  240. //        of the PICT image in this PICT file.  The caller is responsible for disposing of
  241. //        the rectangle.
  242. //    Bugs:
  243. //        We blindly assume the memory allocation worked.
  244. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  245. - (PICTRect*) GetBounds
  246. {
  247.     PICTRect*    tempRect;
  248.  
  249.     tempRect = (PICTRect*) NewByteString(sizeof(PICTRect));
  250.     tempRect->left = BoundingRect->left;
  251.     tempRect->right = BoundingRect->right;
  252.     tempRect->top = BoundingRect->top;
  253.     tempRect->bottom = BoundingRect->bottom;
  254.  
  255.     return tempRect;
  256. }
  257.  
  258.  
  259.  
  260. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  261. //    Routine:        GetOpcode
  262. //    Parameters:    none
  263. //    Returns:        A PICT opcode
  264. //    Stores:        none
  265. //    Description:
  266. //        Reads the next opcode from the PICT file and returns it.  This reads either a
  267. //        one or two byte opcode, depending on whether it's version 1 or 2 (or above).  If
  268. //        the version is 2 or above, it will also automatically move to the next even word
  269. //        boundrary to read the next opcode.
  270. //    History:
  271. //        93.08.01    djb    Added NXSwap code for endianness
  272. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  273. //    Bugs:
  274. //        By always returning the FF opcode when we've reached the end, things must
  275. //        be carefull that they don't loop forever somehow....
  276. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  277. - (PICTOpcode) GetOpcode
  278. {
  279.     PICTOpcode    theOpcode;
  280.     
  281.     if (FoundEnd == YES)
  282.         theOpcode = 0xFF;
  283.     else
  284.     {
  285.         switch (PICTVersion)
  286.         {
  287.             case 0:
  288.             case 1: 
  289.                 theOpcode = [self   ReadByte];
  290.                 break;
  291.             case 2:
  292.                 //
  293.                 //    Pict 2 opcodes always occur on 16 bit boundaries.  If we aren't on
  294.                 //    an even byte number, then scoot forward a byte.
  295.                 //
  296.                 if (EvenUnsignedNum([self   GetCurrentPosition]) != YES)
  297.                     [self   AdvanceBytes: 1];
  298.                 [self   Read: 2 BytesInto: (ByteString) &theOpcode];
  299.                 theOpcode = (PICTOpcode)NXSwapBigShortToHost(theOpcode);
  300.                 break;
  301.             default:
  302.                 //
  303.                 // if we don't know the current version, try to quit with the quit opcode.
  304.                 //
  305.                 theOpcode = 0xFF;
  306.                 FoundEnd = YES;
  307.                 break;
  308.         }
  309.         if (theOpcode == 0xFF)
  310.             FoundEnd = YES;
  311.     }
  312.     return theOpcode;
  313. }
  314.  
  315.  
  316. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  317. //    Routine:        GetRect
  318. //    Parameters:    none
  319. //    Returns:        A Pict rectangle  (ptr to)  (or pass NULL if an erorr occurred)
  320. //    Stores:        none
  321. //    Description:
  322. //        Reads an 8 byte PICT rectangle from the PICT file, and returns this
  323. //        copy to the caller.
  324. //    History:
  325. //        93.08.01    djb    Added NXSwap code for endianness
  326. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  327. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  328. //    Bugs:
  329. //        We set no error codes.
  330. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  331. - (PICTRect*) GetRect
  332. {
  333.     PICTRect*    tempRect;
  334.  
  335.     tempRect = (PICTRect*) NewByteString(sizeof(PICTRect));
  336.  
  337.     [self   Read: 8 BytesInto: (ByteString) tempRect];
  338.     tempRect->left = (INTEGER) NXSwapBigShortToHost(tempRect->left);
  339.     tempRect->right = (INTEGER) NXSwapBigShortToHost(tempRect->right);
  340.     tempRect->top = (INTEGER) NXSwapBigShortToHost(tempRect->top);
  341.     tempRect->bottom = (INTEGER) NXSwapBigShortToHost(tempRect->bottom);
  342.  
  343.  
  344.     if ([self   GetErrorCode] != ERR_OK)
  345.     {
  346.         FreeByteString((ByteString) tempRect);
  347.         tempRect = NULL;
  348.     }
  349.  
  350.     return tempRect;
  351. }
  352.  
  353.  
  354.  
  355. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  356. //    Routine:        GetPoint
  357. //    Parameters:    none
  358. //    Returns:        A Pict point  (ptr to)  (or pass NULL if an erorr occurred)
  359. //    Stores:        none
  360. //    Description:
  361. //        Reads a 4 byte point from the PICT file and returns a copy to the caller.
  362. //    History:
  363. //        93.08.01    djb    Added NXSwap code for endianness
  364. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  365. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  366. //    Bugs:
  367. //        We set no error codes.
  368. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  369. - (PICTPoint*) GetPoint
  370. {
  371.     PICTPoint*    tempPt;
  372.  
  373.     tempPt = (PICTPoint*) NewByteString(sizeof(PICTPoint));
  374.  
  375.     [self   Read: 4 BytesInto: (ByteString)tempPt];
  376.     tempPt->x = (INTEGER) NXSwapBigShortToHost(tempPt->x);
  377.     tempPt->y = (INTEGER) NXSwapBigShortToHost(tempPt->y);
  378.  
  379.     if ([self   GetErrorCode] != ERR_OK)
  380.     {
  381.         FreeByteString((ByteString) tempPt);
  382.         tempPt = NULL;
  383.     }
  384.  
  385.     return tempPt;
  386. }
  387.  
  388.  
  389. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  390. //    Routine:        GetByte
  391. //    Parameters:    none
  392. //    Returns:        A byte
  393. //    Stores:        none
  394. //    Description:
  395. //        This is just like ReadByte in the File class.  It reads a byte and returns it
  396. //        to the caller.  This is provided for naming consistancy with the other methods here.
  397. //    Bugs:
  398. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  399. - (Byte) GetByte
  400. {
  401.     return    [self   ReadByte];
  402. }
  403.  
  404.  
  405. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  406. //    Routine:        GetSignedByte
  407. //    Parameters:    none
  408. //    Returns:        A byte
  409. //    Stores:        none
  410. //    Description:
  411. //        This is just like ReadByte in the File class.  It reads a byte and returns it
  412. //        to the caller.  This is provided for naming consistancy with the other methods here.
  413. //    Bugs:
  414. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  415. - (SignedByte) GetSignedByte
  416. {
  417.     return    (SignedByte) [self   ReadByte];
  418. }
  419.  
  420.  
  421.  
  422. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  423. //    Routine:        GetPString
  424. //    Parameters:    none
  425. //    Returns:        A CString, or a NullCString if a problem occurred.
  426. //    Stores:        none
  427. //    Description:
  428. //        This reads in a Pascal style string from the PICT file, and returns the copy
  429. //        as a CString structure to the caller (who is responsible for disposing of it)
  430. //        Note, though, thatthe file reading routines it calls may store errors...
  431. //    Bugs:
  432. //        Not checking them error codes again....
  433. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  434. - (CString) GetPString
  435. {
  436.     Byte    length;
  437.     CString    theString;
  438.     
  439.     length = [self   ReadByte];
  440.     theString = NewCString(length);
  441.     [self   Read: length BytesInto: (ByteString) theString];
  442.     theString[length] = EndOfCString;
  443.  
  444.     return theString;
  445. }
  446.  
  447.  
  448. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  449. //    Routine:        GetINTEGER
  450. //    Parameters:    none
  451. //    Returns:        An integer
  452. //    Stores:        none
  453. //    Description:
  454. //        This reads a 2 byte signed integer in and then returns it to the caller as an
  455. //        Integer type
  456. //    History:
  457. //        93.08.01    djb    Added NXSwap code for endianness
  458. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  459. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  460. //    Bugs:
  461. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  462. - (Integer) GetINTEGER
  463. {
  464.     Signed16Bits    theInt;    
  465.     [self   Read: 2 BytesInto:  (ByteString) &theInt];
  466.     return     (INTEGER) NXSwapBigShortToHost(theInt);
  467. }
  468.  
  469.  
  470. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  471. //    Routine:        GetPositiveINTEGER
  472. //    Parameters:    none
  473. //    Returns:        A positive integer
  474. //    Stores:        none
  475. //    Description:
  476. //        This reas a 2 byte signed integer in and then returns it to the caller as a
  477. //        PositiveInteger type.
  478. //    History:
  479. //        93.08.01    djb    Added NXSwap code for endianness
  480. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  481. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  482. //    Bugs:
  483. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  484. - (PositiveInteger) GetPositiveINTEGER
  485. {
  486.     bits16    theInt;    
  487.     [self   Read: 2 BytesInto:  (ByteString) &theInt];
  488.     return     (bits16) NXSwapBigShortToHost(theInt);
  489. }
  490.  
  491.  
  492. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  493. //    Routine:        GetLONGINT
  494. //    Parameters:    none
  495. //    Returns:        A long int
  496. //    Stores:        none
  497. //    Description:
  498. //        This reads a 4 byte signed integer in and then returns it to the caller as an
  499. //        Integer type.
  500. //    History:
  501. //        93.08.01    djb    Added NXSwap code for endianness
  502. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  503. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  504. //    Bugs:
  505. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  506. - (Integer) GetLONGINT
  507. {
  508.     Signed32Bits    theInt;    
  509.     [self   Read: 4 BytesInto:  (ByteString) &theInt];
  510.     return     (LONGINT) NXSwapBigLongToHost(theInt);
  511. }
  512.  
  513.  
  514. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  515. //    Routine:        GetPositiveLONGINT
  516. //    Parameters:    none
  517. //    Returns:        A positive integer
  518. //    Stores:        none
  519. //    Description:
  520. //        This reas a 2 byte signed integer in and then returns it to the caller as a
  521. //        PositiveInteger type.
  522. //    History:
  523. //        93.08.01    djb    Added NXSwap code for endianness
  524. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  525. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  526. //    Bugs:
  527. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  528. - (PositiveInteger) GetPositiveLONGINT
  529. {
  530.     bits32    theInt;    
  531.     [self   Read: 4 BytesInto:  (ByteString) &theInt];
  532.     return     (bits32) NXSwapBigLongToHost(theInt);
  533. }
  534.  
  535.  
  536. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  537. //    Routine:        GetFixedNumber
  538. //    Parameters:    none
  539. //    Returns:        A real number
  540. //    Stores:        none
  541. //    Description:
  542. //        This reas a 4 byte signed integer in and then converts it to the fixed pont number
  543. //        it really is by shoving a decimal point in after the 16th bit, and returning as
  544. //        a real number..
  545. //    History:
  546. //        93.08.01    djb    Added NXSwap code for endianness
  547. //        93.08.15    djb    Argh!  I need to be casting the results!!!
  548. //        93.08.16    djb    Argh! again! Wasn't casting properly in all cases.
  549. //    Bugs:
  550. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  551. - (Real) GetFixedNumber
  552. {
  553.     Signed32Bits    fixedNumber;
  554.     [self   Read: 4 BytesInto:  (ByteString) &fixedNumber];
  555.     fixedNumber = (LONGINT) NXSwapBigLongToHost(fixedNumber);
  556.     return fixedNumber / 65536.0;
  557. }
  558.  
  559.  
  560. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  561. //    Routine:        GetPolyVerbs
  562. //    Parameters:    none
  563. //    Returns:        an 8 bit bitfield of options for drawing a polygon.
  564. //    Stores:        none
  565. //    Description:
  566. //        This merly provides a way for the app to read in the bitfield that is used for
  567. //        one of the piccomments.  This way if we need to ever tweak the data, we can do
  568. //        it just here.
  569. //    Bugs:
  570. //        This does some really gross typecasting to convert the 1 byte value to a 1 byte
  571. //        bitfield.  I'm sure there are easier ways...
  572. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  573. - (TPolyVerbRec) GetPolyVerbs
  574. {
  575.     TPolyVerbRec * dummy;
  576.     Byte  temp = [self   ReadByte];
  577.     dummy =  (TPolyVerbRec *) & temp;
  578.     return *dummy;
  579. }
  580.  
  581.  
  582. @end
  583.  
  584.